Virtual machine boot data prediction

ABSTRACT

An indication that a virtual machine is starting is received. Requested data blocks associated with the virtual machine are identified. Based on identifiers of the requested data blocks, a trained learning model is used to predict one or more subsequent data blocks likely to be requested while the virtual machine is starting. The one or more subsequent data blocks are caused to be preloaded in a cache storage.

BACKGROUND OF THE INVENTION

A virtual machine may be started in response to a start command. Thevirtual machine has an associated boot sequence. Executing the bootsequence will result in accessing a sequence of data blocks. The datablocks of the boot sequence are interdependent on each other. The bootsequence is comprised of a plurality of data blocks. The boot sequencehas an associated order in which the plurality of data blocks are usedto start the virtual machine. The plurality of data blocks may befetched from a filesystem in the associated order to start the virtualmachine.

A filesystem may separately request from the disk storage each of thedata blocks required by the boot sequence. The disk may spin up, locatedthe requested data block, and provide the requested data block to thefilesystem. The filesystem may process the data block and then requestthe next data block included in the boot sequence. It may take a longtime to start a virtual machine based on the amount of data included inthe virtual machine boot sequence.

BRIEF DESCRIPTION OF THE DRAWINGS

Various embodiments of the invention are disclosed in the followingdetailed description and the accompanying drawings.

FIG. 1 is a block diagram illustrating an embodiment of a system forstarting backed up versions of a plurality of virtual machines.

FIG. 2 is a block diagram illustrating an embodiment of a virtualmachine boot sequence.

FIG. 3 is a block diagram illustrating an embodiment of a storage node.

FIG. 4 is a flow chart illustrating an embodiment of a process forprefetching boot sequence data blocks.

FIG. 5 is a flow chart illustrating an embodiment of a process forprefetching boot sequence data blocks.

FIG. 6 is a flow chart illustrating an embodiment of a process forstarting a virtual machine.

FIG. 7 is a flow chart illustrating an embodiment of a process fortraining a model.

FIG. 8 is a block diagram illustrating a graph structure of a model inaccordance with some embodiments.

DETAILED DESCRIPTION

A virtual machine may require a certain amount of time to start. Avirtual machine may use a particular boot sequence to start the virtualmachine (e.g., access a specific sequence of data blocks while bootingup). The data blocks included in the boot sequence may be stored innon-contiguous locations on a disk. In some embodiments, at least two ofthe data blocks included in the boot sequence have a same size. In someembodiments, at least two of the data blocks included in the bootsequence have a different size. A filesystem of a storage system maysend to the disk individual requests for each of the data blocksincluded in the boot sequence. In response to a request, a disk may spinup and the requested data block is provided to the filesystem. Inresponse to receiving the data block, the filesystem may process thedata block and provide the data block to a virtual machine environmentto start the virtual machine. A storage system may spin up the disk eachtime that a data block included in the boot sequence is requested andretrieved. The amount of time needed to start the virtual machine maydepend on a length of the particular boot sequence and the number oftimes that a disk is spun up to retrieve the data blocks included in theboot sequence. The amount of time needed to start the virtual machinemay be reduced by prefetching to a cache storage some of the data blocksincluded in the boot sequence. A disk may be idle (e.g., receiving nodata requests) between the time a requested data block is provided to afilesystem and the filesystem requests a next data block of the bootsequence.

A storage system may store many different virtual machines (e.g.,hundreds, thousands). The boot sequence associated with each of thevirtual machines may be different. The storage system may also storemany versions of a virtual machine. For example, a software update mayoccur for one of the applications associated with the virtual machine.The boot sequence associated with each of the different versions of thevirtual machine may also be different. The virtual machine may alsoundergo one or more changes. For example, the operating system of thevirtual machine may change, which may cause the boot sequence associatedwith the virtual machine to change. Thus, merely memorizing the bootsequence associated with a virtual machine and prefetching the memorizedboot sequence may be inefficient due to incorrect pre-fetching of datablocks.

A filesystem (e.g., distributed filesystem, distributed block devicesystem, non-distributed filesystem, etc.) may receive from an applianceon which a virtual machine may run (e.g., virtual machine environment),a request to retrieve a data block from a storage (e.g., raw disk,virtual disk, hard disk, flash drive, tape devices, offboard storage,networked storage, cloud storage, a subsystem that stores the virtualmachine execution data blocks, filesystem, file exposed as a disk (e.g.,using SCSI protocol), raw filesystem, etc.) during execution of the bootsequence. The filesystem may determine whether the requested data blockhas been prefetched to a cache storage. A prediction engine mayimplement a trained model to predict one or more data blocks from thestorage. The trained model may predict data blocks included in a bootsequence of a virtual machine and the predicted data blocks may beprefetched from the storage to a cache storage. The predicted datablocks may be prefetched while the storage is idle (e.g., waiting for arequest from the filesystem). In the event the requested data block hasbeen prefetched to the cache storage, the filesystem may load therequested data block from the cache storage to a virtual machineenvironment in which the virtual machine is being started. This mayreduce the amount of time to start the virtual machine becauseretrieving a data block from a cache storage is faster than retrievingthe data block from the storage. In the event the requested data blockhas not been prefetched to the cache storage, the requested data blockmay be loaded from the storage to a virtual machine environment in whichthe virtual machine is being started.

A model may be trained to predict one or more data blocks in a bootsequence. A boot sequence of a virtual machine may be learned each timea virtual machine is run on a storage system. The boot sequence of thevirtual machine may be monitored as the virtual machine is beingstarted. The monitored boot sequence may be stored and provided as aninput to train a model. The model may develop a graph structure for aplurality of virtual machines. The graph structure may be comprised of aplurality of branches where each branch corresponds to one of theplurality of virtual machines. A branch may be comprised of a pluralityof states. A state is reference to a data block in a filesystem. Eachstate of a branch may correspond to a data block included in the bootsequence. Each subsequent state of a branch may correspond to a nextdata block included in the boot sequence, i.e., the first state of abranch corresponds to an initial data block of the boot sequence and alast state of the branch corresponds to the last data block of the bootsequence. Some of the branches of the graph structure may overlap, i.e.,a data block is included in plurality of boot sequences. A parent statemay have one or more pointers to one or more child states. In someembodiments, the graph structure may have self-referential loops and/orcycles. For example, a state may reference itself. A child state mayreference an elder state (e.g., parent state or a grandparent state). Insome embodiments, the model is a statistical model, such as a Markovchain based prediction model where corresponding probabilities areassociated with each of the child states. For example, a parent statemay include pointers to three child states. The path from the parentstate to the first child state may have a first probability, the pathfrom the parent state to the second child state may have a secondprobability, and the path from the parent state to the third child statemay have a third probability. The corresponding probabilities may beused to predict one or more subsequent data blocks. For example, thedata block corresponding to child state with the highest probabilityamong the three child states may be predicted as one or more subsequentdata blocks. In some embodiments, the model is a machine learning model(e.g., unsupervised, supervised, linear regression, decision tree,support vector machine, naïve Bayes, random forest, etc.).

The prediction engine may monitor a boot sequence associated with avirtual machine. The prediction engine may monitor a threshold number ofprevious data block requests. The prediction engine may predict one ormore subsequent data blocks associated with the boot sequence based onthe monitored threshold number of previous data block requests. In someembodiments, the threshold number of previous data block requests isequal to two. For example, the prediction engine may monitor therequests for the second and third data blocks of the boot sequence topredict the fourth data block of the boot sequence.

A size of a cache storage is finite. The number of prefetched datablocks may be based on the size of the cache storage. The predictionengine may request that a prefetch engine prefetch the predictedsubsequent data block. In some embodiments, the prediction engine mayrequest that the prefetch engine not only prefetch the predictedsubsequent data block, but also one or more other predicted subsequentdata blocks of the boot sequence. For example, the prediction engine maypredict that the seventh block of boot sequence is “Block 9.” Theprediction engine may also predict with reasonable certainty (e.g., aprobability greater than a threshold) that the eighth block of the bootsequence is “Block 25.” Instead of only sending to the prefetch engine arequest for “Block 9,” the prediction engine may send to the prefetchengine a request for “Block 9” and “Block 25.” In some embodiments, thedata blocks associated with a virtual machine boot sequence aresequential. The prediction engine may request the prefetch engine toprefetch a plurality of sequential data blocks. For example, instead ofonly sending to the prefetch engine a request for “Block 9,” theprediction engine may send to the prefetch engine a request for “Block9” and “Block 10.” The prediction engine may vary the number ofrequested data blocks with each request based on a probabilityassociated with the one or more subsequent data blocks. For example, theprediction engine may request one data block, then two data blocks, thenone data block, and then five data blocks. The one or more prefetchedblocks may overwrite the one or more least recently used data blocksstored in the cache storage.

In some embodiments, the number of prefetched data blocks is the maximumnumber of data blocks capable of being stored in the cache storage. Forexample, an end portion of the boot sequence (e.g., the last set of datablocks required by the boot sequence) is being loaded and the predictionengine, with reasonable certainty, may predict all of the data blocksincluded in the end portion. For example, the boot sequence of a virtualmachine may be following a branch of a model where none of the states ofthe branch reference other states of different branches. In someembodiments, the number of prefetched data blocks is one less than themaximum number of data blocks capable of being stored in the cachestorage. For example, the prefetch engine may have prefetched a datablock that has yet to be loaded into a virtual machine environmentassociated with the virtual machine to be started. The number ofprefetched data blocks may be one less than the maximum number of datablocks capable of being stored in the cache storage to prevent analready prefetched data block from being overwritten before the alreadyprefetched data block is loaded into the virtual machine environmentassociated with the virtual machine to be started. In some embodiments,the number of prefetched data blocks is between one data block and lessthan one less than the maximum number of data blocks capable of beingstored in the cache storage. In some embodiments, the number ofprefetched data blocks is based on corresponding probabilitiesassociated with the data blocks. A data block may be prefetched in theevent the probability of the data block being in the boot sequence ofthe virtual machine is greater than a probability threshold. In someembodiments, the prefetched data blocks overwrite the least recentlyused data blocks stored in the cache storage.

Each time a data block associated with the boot sequence is requested,the prediction engine may re-evaluate its prediction. For example, theprediction engine may predict that a data block will be requested in aboot sequence. However, as the virtual machine continues to start, theprediction engine may determine that one of its predictions is incorrectbecause the predicted data block was not included in the actual bootsequence. The prediction engine may continue to monitor the bootsequence, predict one or more other data blocks to be included in theboot sequence based on the actual boot sequence, and request the one ormore predicted data blocks to be prefetched.

At some point in time, the virtual machine will have started (i.e., theboot sequence has ended). The prediction engine may determine that thevirtual machine has started based on a frequency at which data blocksare requested. The prediction engine may determine that the virtualmachine has started in the event the frequency at which data blocks arerequested is less than a threshold. Upon determining that the virtualmachine has started, the prediction engine may update its predictionmodel based on the actual boot sequence of the virtual machine. In someembodiments, the boot sequence is determined to have ended after athreshold period of time (e.g., 1 min). In some embodiments, the bootsequence is determined to have ended when a hit/miss rate (ratio ofcorrectly predicted data blocks to incorrectly predicted data blocks) isless than a threshold.

The start time associated with a virtual machine may be reduced in theevent the prediction engine is correct in predicting one or more datablocks associated with the boot sequence of a virtual machine. Theamount of time that the start time is reduced depends on an accuracy ofthe prediction engine. The accuracy of the prediction engine may improveover time as more virtual machines are started because the model used bythe prediction engine may be updated each time a virtual machine isstarted.

FIG. 1 is a block diagram illustrating an embodiment of a system forstarting backed up versions of a plurality of virtual machines. In theexample shown, system 100 is comprised of primary system 102 that iscoupled to storage system 112 via connection 110. Connection 110 may bea wired or wireless connection. Connection 110 may be a LAN, WAN,intranet, the Internet, and/or a combination thereof.

Primary system 102 may be comprised of one or more virtual machines 103and a backup agent 104. Primary system 102 may include one or morestorage volumes (not shown) that are configured to store filesystem dataassociated with primary system 102. The filesystem data associated withprimary system 102 includes the data associated with the one or morevirtual machines 103.

Backup agent 104 may be configured to cause primary system 102 toperform a backup snapshot of one of the one or more virtual machines103. The backup snapshot may be a full snapshot or an incrementalsnapshot. A full snapshot may include all of the filesystem dataassociated with a virtual machine at a particular moment in time. Anincremental snapshot may include all of the filesystem data associatedwith a virtual machine that was not included in a previous backupsnapshot. Backup agent 104 may cause primary system 102 to perform abackup snapshot according to the backup snapshot policy. Backup agent104 may receive an instruction to perform a backup snapshot from storagesystem 112. In some embodiments, backup agent 104 is optional. In theevent primary system 102 does not include backup agent 104, anapplication associated with the one or more virtual machines 103 maycause a backup snapshot (full or incremental) of one or more of thevirtual machine(s) 103.

Storage system 112 is comprised of a storage cluster that includes aplurality of storage nodes 111, 113, 115. Although three storage nodesare shown, storage system 112 may be comprised of n storage nodes. Theplurality of storage nodes may be comprised of one or more solid statedrives, one or more hard disk drives, one or more cache storages, or acombination thereof. Each storage node may have its own correspondingprocessor. Storage system 112 may be configured to ingest a backupsnapshot received from primary system 102 and configured to store thedata associated with the backup snapshot across the storage cluster.Storage system 112 may be a cloud version of a secondary storage systemas described in U.S. patent application Ser. No. 16/287,214 entitled“Deploying A Cloud Instance Of A User Virtual Machine,” filed on Feb.27, 2019, the entire contents of which are incorporated by reference.

Storage system 112 may include a filesystem 117 that is configured toorganize the filesystem data of the backup snapshot using a tree datastructure as described in U.S. patent application Ser. No. 16/110,314entitled “Incremental Virtual Machine Metadata Extraction,” filed onAug. 23, 2018, the entire contents of which are incorporated byreference. The tree data structure may provide a view of the filesystemdata corresponding to a backup snapshot. The view of the filesystem datacorresponding to the backup snapshot may be comprised of a filesystemmetadata snapshot tree and one or more file metadata trees. Thefilesystem metadata snapshot tree is configured to store metadataassociated with the filesystem data. A file metadata tree may correspondto one of the files included in the backup snapshot and store themetadata associated with a file. For example, a file metadata tree maycorrespond to a virtual machine container file (e.g., virtual machineimage file, virtual machine disk file, etc.) associated with one of theone or more virtual machines 103.

Regardless if the view of the filesystem data corresponds to a fullsnapshot or an incremental snapshot, the view of the filesystem datacorresponding to the backup snapshot is a fully hydrated backup snapshotthat provides a complete view of primary system 102 corresponding to amoment in time when the backup snapshot was performed. A fully hydratedbackup is a backup that is ready for use without having to reconstruct aplurality of backups to use it. Other systems may reconstruct a backupby starting with a full backup and applying one or more changesassociated with one or more incremental backups to the data associatedwith the full backup. In contrast, any file stored in the storage volumeof a primary system at a particular time and the file's contents, forwhich there is an associated backup snapshot, may be determined from thefilesystem metadata snapshot tree, regardless if the associated backupsnapshot was a full snapshot or an incremental snapshot.

Creating an incremental snapshot may only include copying data of thestorage volume(s) that was not previously backed up. However, thefilesystem metadata snapshot tree corresponding to the incrementalsnapshot provides a complete view of the storage volume(s) at theparticular moment in time because it includes references to data of thestorage volume that was previously stored. For example, a root nodeassociated with the filesystem metadata snapshot tree may include one ormore references to leaf nodes associated with one or more previousbackup snapshots and one or more references to leaf nodes associatedwith the current backup snapshot. This provides significant savings inthe amount of time needed to restore or recover a storage volume,virtual machine, and/or a database. In contrast, otherrecovery/restoration methods may require significant time, storage, andcomputational resources to reconstruct a particular version of a volume,virtual machine, and/or database from a full backup and a series ofincremental backups. The view of filesystem data may allow any file(e.g., a virtual machine container file) that was stored on primarysystem 102 at the time the corresponding backup snapshot was performed,to be retrieved, restored, replicated, or started on storage system 112.

A filesystem metadata snapshot tree includes a root node, one or morelevels of one or more intermediate nodes associated with the root node,and one or more leaf nodes associated with an intermediate node of thelowest intermediate level. The root node of a filesystem metadatasnapshot tree includes one or more pointers to one or more intermediatenodes. The root node corresponds to a particular backup snapshot offilesystem data. Each intermediate node includes one or more pointers toother nodes (e.g., a lower intermediate node or a leaf node). A leafnode of the filesystem metadata snapshot tree may store data associatedwith a file for a file that is less than or equal to a limit size (e.g.,256 kB). A leaf node of the filesystem metadata snapshot tree may be anindex node (inode). A leaf node of the filesystem metadata snapshot treemay store a pointer to a file metadata tree for a file that is greaterthan the limit size.

A file metadata tree includes a root node, one or more levels of one ormore intermediate nodes associated with the root node, and one or moreleaf nodes associated with an intermediate node of the lowestintermediate level. A leaf node of a filesystem metadata snapshot treemay include a pointer to the root node of the file metadata tree. A filemetadata tree is similar to a filesystem metadata snapshot tree, but aleaf node of a file metadata tree may include an identifier of a databrick associated with one or more data chunks of the file. For example,a leaf node of a file metadata tree may include an identifier of a databrick associated with one or more data chunks of a virtual machinecontainer file. The location of the data chunks associated with a databrick may be identified using a table stored in a metadata store thatmatches brick numbers (i.e., a brick identifier) to chunk identifiers(e.g., SHA-1) or the location of the data brick may be identified basedon the pointer to the data brick. The brick identifier may be used toidentify a corresponding chunk identifier. A file table may associatechunk identifiers (e.g., SHA-1) with chunk files. A virtual machine maybe comprised of a plurality of chunk files. A chunk file is configuredto store a plurality of data chunks. The file table may includeassociate a location of a chunk identifier with an offset within a chunkfile. The identified chunk identifier may be used to identify the chunkfile that stores one or more data chunks associated with a file and afile offset within the identified chunk file.

Metadata store 114 may be distributed across storage nodes 111, 113,115, that is, storage nodes 111, 113, 115 may store at least a portionof metadata store 114. In some embodiments, metadata store 114 is storedon one of the storage nodes 111, 113, 115. Metadata store 114 may bestored in the solid state drives of storage system 112, the one or morehard disk drives of storage system 112, the one or more cache storagesof storage system 112, and/or a combination thereof. Metadata store 114may be configured to store the metadata associated with primary system102 that is included in a backup snapshot. Metadata store 114 may beconfigured to store the file metadata associated with a plurality ofcontent files stored on storage system 112. For example, metadata store114 may store the view of filesystem data corresponding to a backupsnapshot (e.g., a snapshot tree and one or more file metadatastructures).

Filesystem 117 may be configured to start one of the backed up virtualmachines in virtual machine environment 118. The backed up virtualmachine may be started based on a boot sequence associated with thebacked up virtual machine. Filesystem 117 may retrieve from the storagenodes 111, 113, 115, the data blocks associated with a boot sequence ofa backed up virtual machine. The data blocks associated with the bootsequence of the backed up virtual machine may be stored to one or morehard disks of the storage nodes 111, 113, 115.

Some of the data blocks associated with the boot sequence of the backedup virtual machine may be retrieved from the one or more hard disks ofthe storage nodes 111, 113, 115. For example, filesystem 117 may receivea request to retrieve one of the data blocks based on a boot sequence ofthe virtual machine. In response to the request, filesystem 117 maydetermine whether the requested data block has been prefetched to acache storage. In the event the requested data block has not beenprefetched to the cache storage, filesystem 117 may retrieve therequested data block from the one or more hard disks of the storagenodes 111, 113, 115 and provide the requested data block to virtualmachine environment 118.

Some of the data blocks associated with the boot sequence of the backedup virtual machine may be prefetched from a storage of the storage nodes111, 113, 115 (e.g., one or more hard disks and/or solid state drives),that is, one or more data blocks may be prefetched before the one ormore data blocks are needed in the boot sequence of the backed upvirtual machine. For example, filesystem 117 may receive a request toretrieve one of the data blocks based on a boot sequence of the virtualmachine. In response to the request, filesystem 117 may determinewhether the requested data block has been prefetched to a cache storage.In the event the requested data block has been prefetched to the cachestorage, filesystem 117 may retrieve the requested data block from thecache storage and provide the requested data block to virtual machineenvironment 118.

Storage system 112 may have a single filesystem 117 for the plurality ofstorage nodes 111, 113, 115. In some embodiments, each of the storagenodes 111, 113, 115 has a corresponding filesystem that is configured toretrieve data blocks from a cache storage or from a storage (e.g.,disk). Virtual machine environment 118 may be running on one of thestorage nodes 111, 113, 115 or distributed between a plurality of thestorage nodes 111, 113, 115.

FIG. 2 is a block diagram illustrating an embodiment of a virtualmachine boot sequence. Virtual machine boot sequence 200 is comprised ofn data blocks. A virtual machine may be started using virtual machineboot sequence 200. For example, “Block 1” is first loaded into a virtualmachine environment, then “Block 5” is loaded into the virtual machineenvironment, then “Block 6” is loaded into the virtual machineenvironment, . . . , then “Block 8” is loaded into the virtual machineenvironment, then “Block 9” is loaded into the virtual machineenvironment, . . . , and “Block n” is loaded into the virtual machineenvironment.

A prediction engine may predict that one or more data blocks will beloaded into the virtual machine environment and send a request to aprefetch engine to prefetch to a cache storage the one or more predicteddata blocks before the one or more predicted data blocks need to beloaded into the virtual machine environment.

The prediction engine may monitor virtual machine boot sequence 200. Theprediction engine may monitor a threshold number of data block requests.The prediction engine may predict one or more subsequent data blocksassociated with the boot sequence based on the monitored thresholdnumber of data block requests. In some embodiments, the predictionengine may predict one or more subsequent data blocks associated withthe boot sequence based on a last n requested data block(s). In someembodiments, n is equal to two.

For example, a prediction engine may monitor a start of a virtualmachine associated with virtual machine boot sequence 200 and determinethat the virtual machine boot sequence 200 has a boot sequence order of“Block 1,” “Block 5,” and “Block 6.” Based on the monitored bootsequence, the prediction engine may predict that “Block 8” and “Block 9”will be used to start the virtual machine associated with virtualmachine boot sequence 200. The prediction engine send a request to aprefetch engine to prefetch to a cache storage “Block 8” and “Block 9”before “Block 8” and “Block 9” need to be loaded into the virtualmachine environment.

FIG. 3 is a block diagram illustrating an embodiment of a storage node.In the example shown, storage node 300 may be implemented by any of thestorage nodes 111, 113, 115.

Storage node 300 is comprised a virtual machine environment 302, cachestorage 304, prefetch engine 306, prediction engine 308, filesystem 310,and one or more storages 312 (e.g., raw disk, virtual disk, hard disk,flash drive, tape devices, offboard storage, networked storage, cloudstorage, a subsystem that stores the virtual machine execution datablocks, filesystem, file exposed as a disk (e.g., using SCSI protocol),raw filesystem, etc.).

Filesystem 310 may receive a request to start a virtual machine invirtual machine environment 302. Filesystem 310 may load the data blocksassociated with the boot sequence of the virtual machine from the one ormore storages 312 to virtual machine environment 302. Filesystem 310 mayload the data blocks in an order corresponding to the boot sequence ofthe virtual machine.

Prediction engine 308 may monitor the order in which filesystem 310 isretrieving data blocks from the one or more storages 312 and loading theretrieved data blocks to virtual machine environment 302 (e.g.,hypervisor). Each time a data block associated with the boot sequence isbeing loaded to virtual machine environment 302, prediction engine 308may predict one or more data blocks associated with the boot sequence ofthe virtual machine prior to the one or more data blocks being loaded tovirtual machine environment 302 from the one or more storages 312.Prediction engine 308 may send a request to prefetch engine 306 toprefetch the one or more predicted data blocks from the one or morestorages 312. In response to the prefetch request, prefetch engine 306may fetch the one or more requested data blocks from the one or morestorages 312 and store the one or more requested data blocks in cachestorage 304.

For the example, the first three data blocks of the boot sequence mayhave been loaded to virtual machine environment 302. Prediction engine308 may predict the fourth and fifth data blocks of the boot sequencebased on the first three data blocks. Prediction engine 308 may send toprefetch engine 306 a request to prefetch the data blocks correspondingto the fourth and fifth data blocks of the boot sequence. In response tothe request, prefetch engine 306 may prefetch the data blockscorresponding to the fourth and fifth data blocks of the boot sequencefrom the one or more storages 312 and store the data blockscorresponding to the fourth and fifth data blocks of the boot sequencein cache storage 304. The one or more prefetched data blocks mayoverwrite the least recently used data block(s) stored in cache storage304.

In some embodiments, prefetch engine 306 retrieves the data blocks fromthe one or more storages 312. In some embodiments, prefetch engine 306forwards to a prefetch engine hosted on a different storage node therequest for one or more data blocks. In response to the request, theprefetch engine hosted on the different storage node retrieves the oneor more requested data blocks from the one or more storages of thedifferent storage node and provides the one or more requested datablocks to prefetch engine 306. In response to receiving the one or morerequested data blocks, prefetch engine 306 is configured to store theone or more received data blocks to cache storage 304.

Each time a data block associated with the boot sequence is requested,filesystem 310 may determine whether the next data block in the virtualmachine boot sequence has been prefetched to cache storage 304. In theevent the next data block in the virtual machine boot sequence is storedin cache storage 304, filesystem 310 may load the data block from cachestorage 304 to virtual machine environment 302 instead of loading thedata block from the one or more storages 312 to virtual machineenvironment 302. This may reduce the overall time to start the virtualmachine because loading a data block from cache storage 304 to virtualmachine environment 302 is faster than loading the data block from theone or more storages 312 to virtual machine environment 302. In theevent the next data block in the virtual machine boot sequence is notstored in cache storage 304, filesystem 310 may load the data block fromthe one or more storages 312 to virtual machine environment 302. In someembodiments, filesystem 310 loads a data block from the one or morestorages 312 to virtual machine environment 302 because predictionengine 308 has not made a prediction (e.g., an initial number of datablocks of the boot sequence below a threshold number are loaded intovirtual machine environment 302 before prediction engine 308 isconfigured to make a prediction.). In some embodiments, filesystem 310loads a data block from the one or more storages 312 to virtual machineenvironment 302 because prediction engine 308 made an incorrectprediction (e.g., one or more data blocks not included in the virtualmachine boot sequence have been prefetched to cache storage 304.).

FIG. 4 is a flow chart illustrating an embodiment of a process forprefetching boot sequence data blocks. In some embodiments, process 400is implemented by a storage system, such as storage system 112. In someembodiments, process 400 is implemented by a prediction engine, such asprediction engine 308.

At 402, an indication that a virtual machine is starting is received. Astorage system may receive a request to start a virtual machine. Forexample, a remote computer may send to the storage system a request tostart the virtual machine on the storage system. In other embodiments, auser associated with a storage system sends a request to start aparticular version of a virtual machine. In response to the request, thestorage system may start the particular version of the virtual machinein a virtual machine environment. In response to the request, thestorage system may provide to a prediction engine the indication thatthe virtual machine is starting.

At 404, one or more requested data blocks associated with the virtualmachine are identified. The prediction engine may monitor an order ofthe data blocks associated with a boot sequence of the virtual machine.The boot sequence associated with the virtual machine is comprised of aplurality of data blocks. The prediction engine may identify the datablocks associated with the boot sequence that are being loaded to thevirtual machine environment.

At 406, based on identifiers of the requested data blocks, a trainedlearning model is used to predict one or more subsequent data blockslikely to be requested while the virtual machine is starting. A modelmay be trained to predict one or more data blocks in a boot sequence. Aboot sequence of a virtual machine may be learned each time a virtualmachine is run on a storage system. The boot sequence may be provided asinput to train a model. The model may develop a graph structure for aplurality of virtual machines. The graph structure may be comprised of aplurality of branches where each branch corresponds to one of theplurality of virtual machines. A branch may be comprised of a pluralityof states. Each state of a branch may correspond to a data blockincluded in the boot sequence. Each subsequent state of a branch maycorrespond to a next data block included in the boot sequence, i.e., thefirst state of a branch corresponds to an initial data block of the bootsequence and a last state of the branch corresponds to the last datablock of the boot sequence. Some of the branches of the graph structuremay overlap, i.e., a data block is included in plurality of bootsequences. A parent state may have one or more pointers to one or morechild states. In some embodiments, a state may reference itself. In someembodiments, a child state may reference a parent state or a grandparentstate. The model may be a Markov chain based prediction engine wherecorresponding probabilities are associated with each of the childstates. In some embodiments, the model is a machine learning model thatis trained to predict one or more subsequent data blocks based on acurrent data block being loaded. In some embodiments, the model is amachine learning model (e.g., unsupervised, supervised, linearregression, decision tree, support vector machine, naïve Bayes, randomforest, etc.) that is trained to predict one or more subsequent datablocks based on a current data block being loaded and one or moreprevious data blocks that were loaded. The machine learning model may beconfigured to predict the one or more likely subsequent data blocks. Themachine learning model may be configured to send to the prefetch enginea request for one or more data blocks having a confidence level greaterthan a confidence threshold.

The prediction engine may monitor a threshold number of data blockrequests and predict the subsequent data block associated with the bootsequence based on the monitored threshold number of data block requests.In some embodiments, the threshold number of previous data blockrequests is equal to two. For example, the prediction engine maydetermine that the second and third data blocks of the boot sequence are“Block 7” and “Block 5.” Using the graph structure of the model, theprediction engine may determine that for a virtual machine boot sequencewhere the second and third data blocks of the boot sequence are “Block7” and “Block 5,” the fourth block of boot sequence is likely to be“Block 9” and the fifth block of the boot sequence is likely to be“Block 25.”

The prediction engine may predict one or more subsequent data blocksassociated with the boot sequence each time a data block is loaded intoa virtual machine environment. In some embodiments, the predictionengine predicts one or more subsequent data blocks associated with theboot sequence based on a last n requested data block(s). In someembodiments, n is equal to two.

The predicted subsequent data block may be a threshold number of datablocks after the data block currently being loaded. In some embodiments,the threshold number of data blocks is one. For example, the fourth datablock of the virtual machine boot sequence may be loaded from a storageto a virtual machine environment. The prediction engine may predict thefifth data block of the virtual machine boot sequence. In someembodiments, the threshold number of data blocks is greater than one.For example, the fourth data block of the virtual machine boot sequencemay be loaded from a storage to a virtual machine environment. Theprediction engine may predict the seventh data block of the virtualmachine boot sequence (e.g., the threshold number of data blocks=3)while the fourth data block of the virtual machine boot sequence isbeing loaded from the storage to the virtual machine environment.

At 408, the subsequent data block is caused to be preloaded to a cachestorage. A prediction engine may send to a prefetch engine a request toprefetch the subsequent data block from a storage. In response to therequest, the prefetch engine may be configured to retrieve the requesteddata block from the storage and store the requested data block in acache storage. The subsequent data block may overwrite the leastrecently used data block stored in the cache storage.

At 410, it is determine whether the boot sequence has ended. In someembodiments, the boot sequence is determined to have ended in the eventa threshold amount of time has passed (e.g., 1 minutes) since thevirtual machine began its boot sequence. In some embodiments, the bootsequence is determined to have ended in the event a rate at which datablocks associated with the virtual machine are requested is less than athreshold rate. For example, the rate at which data blocks associatedwith the virtual machine are requested may be higher during a bootsequence of the virtual machine than when the virtual machine isstarted. In some embodiments, the boot sequence is determined to haveended when a hit/miss rate (ratio of correctly predicted data blocks toincorrectly predicted data blocks) is less than a threshold. In theevent the boot sequence has not ended, process 400 returns to 404. Inthe event the boot sequence has ended, process 400 proceeds to 412.

At 412, a prediction model is updated. A model may be trained to predictone or more data blocks associated with a virtual machine boot sequence.The actual boot sequence associated with the virtual machine may beapplied as an input to the model. In response, the model may update itsmodel such that it includes an additional branch that corresponds to theboot sequence of the virtual machine. The additional branch may becomprised of a plurality of states. Each state may correspond to one ofthe data blocks included in the virtual machine boot sequence. The firststate of the Markov chain may correspond to an initial data block of thevirtual machine boot sequence. A last state of the branch may correspondto a last data block of the virtual machine boot sequence.

FIG. 5 is a flow chart illustrating an embodiment of a process forprefetching boot sequence data blocks. Process 500 may be implemented bya prefetch engine, such as prefetch engine 308.

At 502, a request to prefetch one or more data blocks is received. Theone or more data blocks may be associated with a virtual machine bootsequence. The one or more requested data blocks may correspond to datablocks of the virtual machine boot sequence that have not been loadedinto a virtual machine environment.

The requested data block may be a threshold number of data blocks afterthe data block currently being loaded. In some embodiments, thethreshold number of data blocks is one.

For example, the fourth data block of the virtual machine boot sequencemay be loaded from a storage to a virtual machine environment. Theprediction engine may predict the fifth data block of the virtualmachine boot sequence. In some embodiments, the threshold number of datablocks is greater than one. For example, the fourth data block of thevirtual machine boot sequence may be loaded from a storage to a virtualmachine environment. The prediction engine may predict the seventh datablock of the virtual machine boot sequence (e.g., the threshold numberof data blocks=3) while the fourth data block of the virtual machineboot sequence is being loaded from the storage to the virtual machineenvironment. The prediction engine may send a request to prefetch thepredicted seventh data block.

At 504, the one or more requested data blocks are retrieved. The one ormore requested data blocks may be retrieved from storage.

At 506, the one or more requested data blocks are stored in a cachestorage. The one or more requested data blocks may be stored in thecache storage. Each time a filesystem receives a request to load a datablock into a virtual machine environment to start the virtual machine,the filesystem may check to see if the requested data block is stored inthe cache storage. In the event the requested data block is stored inthe cache storage, the filesystem may load the requested data block fromthe cache storage instead of from storage. This reduces the amount oftime to start the virtual machine because retrieving a data block fromcache storage is faster than retrieving the data block from storage.

FIG. 6 is a flow chart illustrating an embodiment of a process forstarting a virtual machine. Process 600 may be implemented by afilesystem, such as filesystem 310 or filesystem 117.

At 602, a request to retrieve a data block from storage is received. Therequested data block may be a next data block in a boot sequenceassociated with a virtual machine. The storage may be a raw disk, avirtual disk, a hard disk, a flash drive, a tape device, offboardstorage, a networked storage, a cloud storage, a subsystem that storesthe virtual machine execution data blocks, a filesystem, a file exposedas a disk (e.g., using SCSI protocol), a raw filesystem, etc. At 604, itis determined whether the requested data block is already stored in acache storage. In the event the requested data block is already storedin a cache storage, process 600 proceeds to 606. In the event therequested data block is not already stored in the cache storage, process600 proceeds to 608. At 606, the requested data block is loaded fromcache to a virtual machine environment. At 608, the requested data blockis loaded from storage to the virtual machine environment. The amount oftime needed to start the virtual machine may be reduced based on thenumber of data blocks associated with the virtual machine boot sequencethat are fetched from the cache storage instead of storage because it isfaster for the filesystem to retrieve a data block from cache storageinstead of the storage.

FIG. 7 is a flow chart illustrating an embodiment of a process fortraining a model. Process 700 may be implemented by a prediction engine,such as prediction engine 308.

At 702, a virtual machine is monitored as it is being started for someor all of its boot sequence. A virtual machine may be started in avirtual machine environment. A user associated with a storage system maysend a request to start a particular version of a virtual machine. Inresponse to the request, the storage system may start the particularversion of the virtual machine in the virtual machine environment.

At 704, a boot sequence associated with the virtual machine isdetermined. The boot sequence associated with the virtual machine iscomprised of a plurality of data blocks. The plurality of data blocksare loaded to the virtual machine environment in a specific order. Thespecific order in which the plurality of data blocks associated with theboot sequence are loaded to the virtual machine environment isdetermined.

At 706, a model is updated. A model may be trained to predict one ormore data blocks associated with a virtual machine boot sequence. Thedetermined boot sequence may be applied as an input to the model. Inresponse, the model may update its model such that it includes anadditional branch that corresponds to the determined boot sequence. Theadditional branch may be comprised of a plurality of states. Each statemay correspond to one of the data blocks included in the virtual machineboot sequence. The first state of the branch may correspond to aninitial data block of the virtual machine boot sequence. A last state ofthe branch may correspond to a last data block of the virtual machineboot sequence.

FIG. 8 is a block diagram illustrating a graph structure of a model inaccordance with some embodiments. In the example shown, graph structure800 illustrates the boot sequence associated with five different virtualmachines. Graph structure 800 may be comprised of a plurality ofbranches where each branch corresponds to one of the plurality ofvirtual machines.

Graph structure 800 may be comprised of a plurality of branches (paths)where each branch corresponds to one of the plurality of virtualmachines. A branch may be comprised of a plurality of states. Each stateof a branch may correspond to a data block included in the boot sequenceassociated with a virtual machine. Each subsequent state of a branch maycorrespond to a next data block included in the boot sequence associatedwith a virtual machine, i.e., the first state of a branch corresponds toan initial data block of the boot sequence and a last state of thebranch corresponds to the last data block of the boot sequence. Some ofthe branches of the graph structure may overlap, i.e., a data block isincluded in plurality of boot sequences. For example, “Block 7,” “Block10,” and “Block 12” are included in the boot sequences associated withtwo different virtual machines. A parent state may have one or morepointers to one or more child states. For example, “Block 4” includes asingle pointer to “Block 20.” “Block 5” includes a first pointer to“Block 6” and a second pointer to “Block 7.” A child state may have apointer to an elder state (e.g., parent state, grandparent state). Forexample, “Block 10” includes a pointer to “Block 3.” A state may includea self-referential pointer (i.e., a self-referential loop). For example“Block 15” includes a pointer to itself.

In the example shown, a first virtual machine is associated with a bootsequence of “Block 1,” “Block 4,” “Block 20,” and “Block 15.” A secondvirtual machine is associated with a boot sequence of “Block 1,” “Block4,” “Block 6,” “Block 8,” and “Block 9.” A third virtual machine isassociated with a boot sequence of “Block 1,” “Block 5,” “Block 6,”“Block 8,” and “Block 9.” A fourth virtual machine is associated with aboot sequence of “Block 1,” “Block 5,” “Block 7,” “Block 10,” and “Block12.” A fifth virtual machine is associated with a boot sequence of“Block 1,” “Block 3,” “Block 7,” “Block 10,” and “Block 12.” Althoughthe example shows a virtual machine having a boot sequence with four orfive blocks, a virtual machine may be associated with a boot sequencehaving m number of blocks, where m is a number greater than 0.

A filesystem may receive corresponding requests for a plurality of datablocks associated with a virtual machine boot sequence each time avirtual machine is started. The requests are received in an orderassociated with the virtual machine boot sequence. For example, afilesystem may receive a request for “Block 1,” then a second requestfor “Block 4,” then a third request for “Block 20,” and then a fourthrequest for “Block 15.” The data blocks associated with the virtualmachine boot sequence may be located at non-contiguous portions of astorage, such as a disk. The disk may be required to spin up each time adata block of the virtual machine boot sequence is requested.

Graph structure 800 may be used to predict one or more data blocksassociated with a boot sequence. A prediction engine may use one or morerequested data blocks associated with a virtual machine boot sequence topredict one or more subsequent data blocks associated with the virtualmachine boot sequence. For example, a prediction engine may use the lasttwo requested data blocks associated with a virtual machine bootsequence to predict one or more subsequent data blocks associated withthe virtual machine boot sequence. “Block 1” and “Block 5” may have beenrequested and loaded into a virtual machine environment used to startthe virtual machine.

The prediction engine may send to a prefetch engine a request toprefetch one or more data blocks associated with a virtual machine bootsequence. Each data block may have an associated probability of beingincluded in a virtual machine boot sequence. The associated probabilitymay change as more and more data blocks are loaded into the virtualmachine environment used to start the virtual machine. In the event“Block 1” and “Block 5” have been requested, “Block 6” and “Block 7”have a greater than zero probability of being requested. In someembodiments, “Block 6” and “Block 7” have the same probability of beingrequested. In other embodiments, “Block 6” has a greater probability ofbeing requested than “Block 7.” In other embodiments, “Block 7” has agreater probability of being requested than “Block 6.” In the event theprobabilities are equal, the prediction engine may send to the prefetchengine a request to prefetch both “Block 6” and “Block 7.” In the eventthe probabilities are not equal, the prediction engine may send to theprefetch engine a request to prefetch the data block having the greaterprobability. In some embodiments, the prefetch engine not only sends arequest for “Block 6,” but the request also includes a request for“Block 8.” In some embodiments, the prefetch engine not only sends arequest for “Block 7,” but the request also includes a request for“Block 10.”

Although graph structure 800 depicts the boot sequence of each virtualmachine starting with “Block 1,” graph structure 800 may include bootsequences of virtual machines having a different starting data blocks,such as “Block 100.” This may occur when different types of virtualmachines are started in a virtual machine environment (e.g., Ubuntu VMs,Windows VMs, etc.).

Each time a virtual machine is started in a virtual machine environment,the boot sequence associated with the virtual machine may be learned andused to update graph structure 800. The boot sequence associated withthe virtual machine may be provided as input to a model, and inresponse, graph structure 800 may be updated to include a branch thatcorresponds to the boot sequence associated with the virtual machine.

The invention can be implemented in numerous ways, including as aprocess; an apparatus; a system; a composition of matter; a computerprogram product embodied on a computer readable storage medium; and/or aprocessor, such as a processor configured to execute instructions storedon and/or provided by a memory coupled to the processor. In thisspecification, these implementations, or any other form that theinvention may take, may be referred to as techniques. In general, theorder of the steps of disclosed processes may be altered within thescope of the invention. Unless stated otherwise, a component such as aprocessor or a memory described as being configured to perform a taskmay be implemented as a general component that is temporarily configuredto perform the task at a given time or a specific component that ismanufactured to perform the task. As used herein, the term ‘processor’refers to one or more devices, circuits, and/or processing coresconfigured to process data, such as computer program instructions.

A detailed description of one or more embodiments of the invention isprovided along with accompanying figures that illustrate the principlesof the invention. The invention is described in connection with suchembodiments, but the invention is not limited to any embodiment. Thescope of the invention is limited only by the claims and the inventionencompasses numerous alternatives, modifications and equivalents.Numerous specific details are set forth in the description in order toprovide a thorough understanding of the invention. These details areprovided for the purpose of example and the invention may be practicedaccording to the claims without some or all of these specific details.For the purpose of clarity, technical material that is known in thetechnical fields related to the invention has not been described indetail so that the invention is not unnecessarily obscured.

Although the foregoing embodiments have been described in some detailfor purposes of clarity of understanding, the invention is not limitedto the details provided. There are many alternative ways of implementingthe invention. The disclosed embodiments are illustrative and notrestrictive.

What is claimed is:
 1. A method, comprising: receiving an indicationthat a virtual machine is starting; identifying requested data blocksassociated with the virtual machine; based on identifiers of therequested data blocks, using a trained learning model to predict one ormore subsequent data blocks likely to be requested while the virtualmachine is starting; and causing the one or more subsequent data blocksto be preloaded from a storage to a cache storage.
 2. The method ofclaim 1, wherein the identifiers of the requested data blocks areassociated with a boot sequence of the virtual machine.
 3. The method ofclaim 2, wherein the trained learning model predicts the one or moresubsequent data blocks based on a threshold number of the identifiers ofthe requested data blocks.
 4. The method of claim 3, wherein the one ormore subsequent data blocks are a threshold number of data blocks aftera data block being loaded.
 5. The method of claim 1, further comprisingdetermining that the one or more predicted subsequent data blocks areincorrect.
 6. The method of claim 5, further comprising: monitoring aboot sequence of the virtual machine; and using the trained learningmodel to make one or more additional predictions.
 7. The method of claim1, further comprising determining that the one or more predictedsubsequent data blocks are correct.
 8. The method of claim 7, furthercomprising determining whether an end of a boot sequence associated withthe virtual machine has been reached.
 9. The method of claim 8, whereinin response to determining that the end of the boot sequence associatedwith the virtual machine has been reached, using an actual boot sequenceof the virtual machine to update the trained learning model.
 10. Themethod of claim 8, wherein in response to determining that the end ofthe boot sequence associated with the virtual machine has not beenreached, using the trained learning model to make one or more additionalpredictions.
 11. The method of claim 1, wherein causing the one or moresubsequent data blocks to be preloaded in the cache storage comprisessending to a prefetch engine a request for the one or more subsequentdata blocks.
 12. The method of claim 11, wherein in response toreceiving the request for the one or more subsequent data blocks, theprefetch engine retrieves the one or more subsequent data blocks fromthe storage and stores the one or more subsequent data blocks in thecache storage.
 13. The method of claim 1, wherein a filesystem retrievesthe one or more subsequent data blocks from the cache storage and loadsthe one or more subsequent data blocks to a virtual machine environmentassociated with the virtual machine.
 14. The method of claim 1, whereinthe trained learning model uses a graph structure to predict the one ormore subsequent data blocks likely to be requested while the virtualmachine is starting.
 15. The method of claim 14, wherein the graphstructure is comprised of a plurality of branches, wherein each branchcorresponds to a different virtual machine.
 16. The method of claim 15,wherein each branch of the plurality of branches is comprised of aplurality of states, wherein each state corresponds to a data block of aboot sequence.
 17. The method of claim 1, wherein the one or moresubsequent data blocks include a plurality of data blocks that arecaused to be preloaded in the cache storage.
 18. The method of claim 17,wherein the plurality of data blocks are sequential data blocks.
 19. Acomputer program product, the computer program product being embodied ina non-transitory computer readable storage medium and comprisingcomputer instructions for: receiving an indication that a virtualmachine is starting; identifying requested data blocks associated withthe virtual machine; based on identifiers of the requested data blocks,using a trained learning model to predict one or more subsequent datablocks likely to be requested while the virtual machine is starting; andcausing the one or more subsequent data blocks to be preloaded in acache storage.
 20. A system, comprising: a processor configured to:receive an indication that a virtual machine is starting; identifyrequested data blocks associated with the virtual machine; based onidentifiers of the requested data blocks, use a trained learning modelto predict one or more subsequent data blocks likely to be requestedwhile the virtual machine is starting; and cause the one or moresubsequent data blocks to be preloaded in a cache storage; and a memorycoupled to the processor and configured to provide the processor withinstructions.